<template>
  <a-card>
    <template #title>
      <span class="icon"></span>
      <span class="text">我的日程</span>
    </template>
    <a-calendar v-model="date" :modes="modes" />
    <div
      style="
        width: 100%;
        margin: 20px 0;
        font-size: 18px;
        font-weight: 600;
        color: #333;
      "
    >
      我的日程
    </div>
    <a-timeline>
      <a-timeline-item
        v-for="(item, index) in timeArr"
        :key="index"
        :label="item.label"
      >
        <div class="item">
          <div class="top">
            <span
              style="
                width: 40px;
                font-size: 16px;
                font-weight: 600;
                color: #2476ff;
              "
              >课程</span
            >
            <span class="name">{{ item.name }}</span>
            <span class="status">{{ item.status }}</span>
          </div>
          <div class="bottom">
            <div class="icon"></div>
            <div class="txt">{{ item.address }}</div>
          </div>
        </div>
      </a-timeline-item>
    </a-timeline>
  </a-card>
</template>

<script lang="ts" setup>
import { ref, onMounted } from "vue";

const timeArr = ref([]);
const modes = ref([]);
const fetchData = () => {
  timeArr.value = [
    {
      content: "网上选课26",
      label: "上午8点",
      name: "哲学（中国哲学史）",
      status: "即将开始>",
      address: "地址：4教309",
    },
    {
      content: "网上选课24",
      label: "上午8点",
      name: "哲学（中国哲学史）",
      status: "即将开始>",
      address: "地址：4教309",
    },
    {
      content: "网上选课26",
      label: "上午8点",
      name: "哲学（中国哲学史）",
      status: "即将开始>",
      address: "地址：4教309",
    },
    {
      content: "网上选课23",
      label: "上午8点",
      name: "哲学（中国哲学史）",
      status: "即将开始>",
      address: "地址：4教309",
    },
    {
      content: "网上选课22",
      label: "上午8点",
      name: "哲学（中国哲学史）",
      status: "即将开始>",
      address: "地址：4教309",
    },
  ];
};
const date = ref(new Date("2023-01-01"));

onMounted(() => {
  fetchData();
});
</script>

<style lang="less" scoped>
.arco-card {
  width: 100%;
  height: 630px !important;
  margin: 1% auto;
  background: #fff;
  border-radius: 10px;

  .arco-card-body {
    display: flex;
    align-items: center;
    justify-content: start;
    overflow: auto;
  }

  .arco-card-header-title {
    display: flex;
    align-items: center;

    .icon {
      display: inline-block;
      width: 18px;
      height: 18px;
      margin-right: 8px;
      background: url("@/assets/images/计划.png") center center no-repeat;
      background-size: contain;
    }

    .text {
      font-family: SourceHanSansSCVF-Medium;
      font-size: 18px;
      font-weight: 500;
      line-height: 20px;
      color: #9caaba;
    }
  }

  /deep/ .arco-calendar-month-row {
    height: 30px !important;
    .arco-calendar-cell .arco-calendar-date {
      padding: 0;
      display: flex;
      justify-content: center;
      align-items: center;
      .arco-calendar-date-value {
        font-size: 14px !important;
      }
    }
  }

  /deep/.arco-timeline-item-content {
    width: 380px;
    height: 70px;
    background: #f4f7ff;
    border: 1px solid #e5eefe;
    border-radius: 4px;

    .item {
      display: flex;
      flex-direction: column;
      width: 100%;
      height: 100%;

      .top {
        display: flex;
        flex: 1;
        justify-content: start;
        width: 100%;
        padding: 0 1%;

        .name {
          flex: 8;
          font-size: 16px;
          font-weight: 500;
          color: #333;
        }

        .status {
          flex: 3;
          font-size: 14px;
          color: #ff5d5d !important;
        }
      }

      .bottom {
        display: flex;
        flex: 1;
        align-items: center;
        justify-content: start;
        width: 100%;

        .icon {
          width: 18px;
          height: 18px;
          margin-right: 10px;
          background: url("@/assets/images/地址.png") center center no-repeat;
          background-size: contain;
        }

        .txt {
          font-size: 14px;
          color: #333;
        }
      }
    }
  }
}
</style>
